import request from '@/utils/request'
import qs from "qs"
/**
 * 委托单
 **/
// 委托单列表

export function getEntrustOrderList(data, pagination) {
  if (pagination) {
    data["pageIndex"] = pagination.pageIndex;
    data["pageSize"] = pagination.pageSize;
  }
  return request({
    url: '/api/v1/EntrustOrder/GetList',
    method: 'get',
    params: data,
    paramsSerializer: (params) => qs.stringify(params)
  })
}
// 客户信息列表
export const getCustomerList = params => request('/api/v1/SysBusinessCustomer/GetList', { params: params });
// 新增委托单
export const Create = data => request.post('/api/v1/EntrustOrder/Create', data);
// 查询单条委托单信息
export const Get = params => request('/api/v1/EntrustOrder/Get', { params: params });
// 编辑委托单
export const Update = data => request.post('/api/v1/EntrustOrder/Update', data);
// 复制委托单信息
export const Copy = data => request.post('/api/v1/EntrustOrder/Copy', data);
// 删除委托单
export const Delete = data => request.delete('/api/v1/EntrustOrder/Delete', { data: data });
// 导入委托单数据
export const ImportEntrustUrl = data => request.post('/api/v1/EntrustOrder/ExcelImport', data);
// 下载委托单模板
export const DownloadEntrustOrderTemplate = params => request('/api/v1/EntrustOrder/DownloadEntrustOrderTemplate', { params: params });
// 查询样品树
export const GetSampleTree = params => request('/api/v1/SysBusinessSampleCategory/GetTree', { params: params });
// 查询检测项目
export const GetDetectionItem = params => request('/api/v1/SysBusinessDetectionItem/GetList', { params: params });
// 查询组合不分页
export const GetListNoPage = params => request('/api/v1/SysBusinessDetectionItemPack/GetListNoPage', { params: params });
// 获取打包的检测项目
export const GetPackDetectionItemData = params => request('/api/v1/SysBusinessDetectionItemPack/GetPackDetectionItemData', { params: params });
// 获取委托单编号
export const GetOrderNumber = data => request.post('/api/v1/EntrustOrder/GetOrderNumber', data);
// 撤回
export const Chehui = data => request.post('/api/v1/EntrustOrder/Chehui', data);
